More problems
[andmenj-acm.git] / Mi manual de algoritmos / version_maraton_interuniversitaria_2008-2 / src / c++ / unicode.tex
blobc80287fa641dc2dcea32a2569496d1a0b90c8d6c
1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 {\ttfamily \raggedright {
4 \noindent
5 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$iostream$>$}} \\
6 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$cassert$>$}} \\
7 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$stdio.h$>$}} \\
8 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$assert.h$>$}} \\
9 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$wchar.h$>$}} \\
10 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$wctype.h$>$}} \\
11 \mbox{}\textbf{\textcolor{RoyalBlue}{\#include}}\ \texttt{\textcolor{Red}{$<$locale.h$>$}} \\
12 \mbox{} \\
13 \mbox{}\textbf{\textcolor{Blue}{using}}\ \textbf{\textcolor{Blue}{namespace}}\ std\textcolor{BrickRed}{;} \\
14 \mbox{} \\
15 \mbox{}\textcolor{ForestGreen}{int}\ \textbf{\textcolor{Black}{main}}\textcolor{BrickRed}{()}\textcolor{Red}{\{} \\
16 \mbox{}\ \ \textbf{\textcolor{Black}{assert}}\textcolor{BrickRed}{(}\textbf{\textcolor{Black}{setlocale}}\textcolor{BrickRed}{(}LC$\_$ALL\textcolor{BrickRed}{,}\ \texttt{\textcolor{Red}{"{}en$\_$US.UTF-8"{}}}\textcolor{BrickRed}{)}\ \textcolor{BrickRed}{!=}\ NULL\textcolor{BrickRed}{);} \\
17 \mbox{}\ \ \textcolor{ForestGreen}{wchar$\_$t}\ c\textcolor{BrickRed}{;} \\
18 \mbox{} \\
19 \mbox{}\ \ wstring\ s\textcolor{BrickRed}{;} \\
20 \mbox{}\ \ \textbf{\textcolor{Blue}{while}}\ \textcolor{BrickRed}{(}\textbf{\textcolor{Black}{getline}}\textcolor{BrickRed}{(}wcin\textcolor{BrickRed}{,}\ s\textcolor{BrickRed}{))}\textcolor{Red}{\{} \\
21 \mbox{}\ \ \ \ wcout\ \textcolor{BrickRed}{$<$$<$}\ L\texttt{\textcolor{Red}{"{}LeĆ­\ :\ "{}}}\ \textcolor{BrickRed}{$<$$<$}\ s\ \textcolor{BrickRed}{$<$$<$}\ endl\textcolor{BrickRed}{;} \\
22 \mbox{}\ \ \ \ \textbf{\textcolor{Blue}{for}}\ \textcolor{BrickRed}{(}\textcolor{ForestGreen}{int}\ i\textcolor{BrickRed}{=}\textcolor{Purple}{0}\textcolor{BrickRed}{;}\ i\textcolor{BrickRed}{$<$}s\textcolor{BrickRed}{.}\textbf{\textcolor{Black}{size}}\textcolor{BrickRed}{();}\ \textcolor{BrickRed}{++}i\textcolor{BrickRed}{)}\textcolor{Red}{\{} \\
23 \mbox{}\ \ \ \ \ \ c\ \textcolor{BrickRed}{=}\ s\textcolor{BrickRed}{[}i\textcolor{BrickRed}{];} \\
24 \mbox{}\ \ \ \ \ \ \textbf{\textcolor{Black}{wprintf}}\textcolor{BrickRed}{(}L\texttt{\textcolor{Red}{"{}\%lc\ \%lc}}\texttt{\textcolor{CarnationPink}{\textbackslash{}n}}\texttt{\textcolor{Red}{"{}}}\textcolor{BrickRed}{,}\ \textbf{\textcolor{Black}{towlower}}\textcolor{BrickRed}{(}s\textcolor{BrickRed}{[}i\textcolor{BrickRed}{]),}\ \textbf{\textcolor{Black}{towupper}}\textcolor{BrickRed}{(}s\textcolor{BrickRed}{[}i\textcolor{BrickRed}{]));} \\
25 \mbox{}\ \ \ \ \textcolor{Red}{\}} \\
26 \mbox{}\ \ \textcolor{Red}{\}} \\
27 \mbox{} \\
28 \mbox{}\ \ \textbf{\textcolor{Blue}{return}}\ \textcolor{Purple}{0}\textcolor{BrickRed}{;} \\
29 \mbox{}\textcolor{Red}{\}} \\
30 \mbox{} \\
31 \mbox{} \\
33 } \normalfont\normalsize